<template>
    <div>
        <ul class="details">
            <li>
                <h1>支付金额</h1>
                <h2>￥{{Amount |amountMin100(2)}}</h2>
            </li>
            <li>
               <div>
                   <img src="../../../assets/personal/images/hongbao.png">
               </div>
               <div>
                   <p>红包支付</p>
                   <p>当前￥{{amountScore |amountMin100(2)}},支付后余额￥
                       <span v-if="amountScore-Amount>0">{{(amountScore-Amount)|amountMin100(2)}}</span>
                       <span v-else>0{{(amountScore-Amount)|amountMin100(2)}}</span></p>
               </div>
            </li>
        </ul>
        <div class="btn" @click="submet_hb">
            立即支付
        </div>
    </div>
</template>
<style>
.btn{
  width: 86%;
  height: 42px;
  margin: 200px 7% auto 7%;
  text-align: center;
  background: red;
  border-radius: 10px;
  line-height: 42px;
  color: white;
  font-weight: 500;
}
.details li:nth-of-type(1){
    height: 140px;
    background: white;
    padding-top: 32px;
    box-sizing: border-box;
}
.details li:nth-of-type(1) h1{
    font-size: 17px;
    margin: 0 auto 23px auto;
}
.details li:nth-of-type(1) h2{
    font-size: 36px;
}
.details li:nth-of-type(2){
    margin-top: 30px;
    height: 61px;
    background: white;
}
.details li:nth-of-type(2) div:nth-of-type(1){
    float: left;
    margin-top: 10px;
    margin-left: 10px;
}
.details li:nth-of-type(2) div:nth-of-type(2){
    float: left;
    margin-top: 5px;
    margin-left: 10px;
    text-align: left;
}
.details li:nth-of-type(2) div:nth-of-type(1) img{
    width: 25px;
    height: 28px;
}
</style>

<script>
export default {
    data () {
        return {
            Amount:this.$route.query.Amount,
            amountScore:this.$route.query.amountScore,
            orderId:this.$route.query.id
        }
    },
    mounted(){

    },
    methods:{
        submet_hb:function(){
            this.$http.post(this.APIURL_PREFIX+"/api/wap/score/pay",$.param({orderId:this.orderId,type:1})).then((response) => {    
             layer.msg("支付成功")
            }).catch(function(err){
               console.log(err)
          })
        }
    }
}
</script>
